<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>3º Trabalho de Sistemas Distribuídos: Referência da Classe filesystem.server.ServerConnection</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">3º Trabalho de Sistemas Distribuídos
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Gerado por Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Busca');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Página&#160;Principal</span></a></li>
      <li><a href="namespaces.html"><span>Pacotes</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Arquivos</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Busca" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Lista&#160;de&#160;Componentes</span></a></li>
      <li><a href="classes.html"><span>Índice&#160;dos&#160;Componentes</span></a></li>
      <li><a href="functions.html"><span>Componentes&#160;Membros</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Todos</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Arquivos</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Funções</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variáveis</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefilesystem.html">filesystem</a></li><li class="navelem"><a class="el" href="namespacefilesystem_1_1server.html">server</a></li><li class="navelem"><a class="el" href="classfilesystem_1_1server_1_1ServerConnection.html">ServerConnection</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Métodos Públicos</a>  </div>
  <div class="headertitle">
<div class="title">Referência da Classe filesystem.server.ServerConnection</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Diagrama de colaboração para filesystem.server.ServerConnection:</div>
<div class="dyncontent">
<div class="center"><img src="classfilesystem_1_1server_1_1ServerConnection__coll__graph.png" border="0" usemap="#filesystem_8server_8ServerConnection_coll__map" alt="Collaboration graph"/></div>
</div>

<p><a href="classfilesystem_1_1server_1_1ServerConnection-members.html">Lista de todos os Membros.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Métodos Públicos</h2></td></tr>
<tr class="memitem:a215f3303754a82166701947e8768bf95"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfilesystem_1_1server_1_1ServerConnection.html#a215f3303754a82166701947e8768bf95">ServerConnection</a> (Socket socket)</td></tr>
<tr class="memitem:a4462539887554fa8be90331edb33968f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfilesystem_1_1server_1_1ServerConnection.html#a4462539887554fa8be90331edb33968f">run</a> ()</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Descrição Detalhada</h2>
<div class="textblock"><p>Trata a conexão de cada requisição individualmente.</p>
<p>Ao receber uma conexão o servidor instancia esta classe e passa ao objeto o controle da comunicação com o requisitante. </p>
</div><hr/><h2>Construtores &amp; Destrutores</h2>
<a class="anchor" id="a215f3303754a82166701947e8768bf95"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">filesystem.server.ServerConnection.ServerConnection </td>
          <td>(</td>
          <td class="paramtype">Socket&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Instancia um tratador de conexão.</p>
<dl class="params"><dt>Parâmetros:</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td>Socket da conexão tratada. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Métodos</h2>
<a class="anchor" id="a4462539887554fa8be90331edb33968f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void filesystem.server.ServerConnection.run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Thread de tratamento de conexões.</p>
<p>Trata a conexão de um cliente com o servidor de acordo com o tipo de requisição.</p>
<p>Mensagem de "READ":</p>
<ul>
<li>read path/to/file pipeID</li>
</ul>
<p>Respostas:</p>
<ul>
<li>ack ok pipeID path/to/file<ul>
<li>Aguarda um mensagem de fim de leitura:<ul>
<li>endRead ok</li>
<li>endRead fail</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li>ack fail BUSY</li>
</ul>
<ul>
<li>ack fail NOT_EXISTS</li>
</ul>
<p>Mensagem de "CREATE":</p>
<ul>
<li>create path/to/file pipeID</li>
</ul>
<p>Respostas:</p>
<ul>
<li>ack ok</li>
<li>ack fail FILE_ALREADY_EXISTS</li>
</ul>
<p>Mensagem de "DELETE":</p>
<ul>
<li>delete path/to/file</li>
</ul>
<p>Respostas:</p>
<ul>
<li>ack ok</li>
<li>ack fail BUSY</li>
</ul>
<p>Mensagem de "WRITE":</p>
<ul>
<li>write path/to/file pipeID</li>
</ul>
<p>Respostas:</p>
<ul>
<li>ack ok</li>
</ul>
<p>ack fail BUSY</p>
<ul>
<li>ack fail NOT_EXISTS</li>
</ul>
<p>Caso uma mensagem inválida seja recebida.</p>
<p>Resposta:</p>
<ul>
<li>ack fail INVALID_COMMAND </li>
</ul>

<p><div class="dynheader">
Este é o diagrama das funções utilizadas por esta função:</div>
<div class="dyncontent">
<div class="center"><img src="classfilesystem_1_1server_1_1ServerConnection_a4462539887554fa8be90331edb33968f_cgraph.png" border="0" usemap="#classfilesystem_1_1server_1_1ServerConnection_a4462539887554fa8be90331edb33968f_cgraph" alt=""/></div>
<map name="classfilesystem_1_1server_1_1ServerConnection_a4462539887554fa8be90331edb33968f_cgraph" id="classfilesystem_1_1server_1_1ServerConnection_a4462539887554fa8be90331edb33968f_cgraph">
<area shape="rect" id="node3" href="classfilesystem_1_1server_1_1file_1_1FileFactory.html#aad82a6450dc283faae8835b77776187e" title="filesystem.server.file.File\lFactory.createFile" alt="" coords="219,5,387,46"/><area shape="rect" id="node5" href="classfilesystem_1_1server_1_1file_1_1FileFactory.html#ad71f1c82b67230f7ae2e2978e6affeeb" title="filesystem.server.file.File\lFactory.deleteFile" alt="" coords="219,70,387,111"/><area shape="rect" id="node9" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#a9b9ec2f841dde92007f6483ebbf855c6" title="filesystem.server.file.File\lHandler.writeRequest" alt="" coords="435,129,603,170"/><area shape="rect" id="node11" href="classfilesystem_1_1server_1_1file_1_1FileFactory.html#a8d4b9631f8deec1482eb2ee37c2a8e96" title="filesystem.server.file.File\lFactory.getFile" alt="" coords="219,187,387,229"/><area shape="rect" id="node13" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#a49be6804a8a6b409c446524b03605667" title="filesystem.server.file.File\lHandler.readRequest" alt="" coords="219,253,387,294"/><area shape="rect" id="node15" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#aa2ddd99cff787ea33609a449a8f2ff8c" title="filesystem.server.file.File\lHandler.getHosts" alt="" coords="219,318,387,359"/><area shape="rect" id="node17" href="classfilesystem_1_1server_1_1file_1_1FileHost.html#a60e62dfc37c74d866b287c8cd4e04be5" title="filesystem.server.file.File\lHost.getHost" alt="" coords="219,383,387,425"/><area shape="rect" id="node19" href="classfilesystem_1_1server_1_1file_1_1FileHost.html#ae0591ba988d43130bf924778551edd6b" title="filesystem.server.file.File\lHost.getPath" alt="" coords="219,449,387,490"/><area shape="rect" id="node21" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#a87fa10e0cde64bc99e0f77ce42c2712b" title="filesystem.server.file.File\lHandler.addHost" alt="" coords="219,514,387,555"/><area shape="rect" id="node23" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#aa2292a41b2130e91a9467f827d48b482" title="filesystem.server.file.File\lHandler.readRelease" alt="" coords="219,579,387,621"/><area shape="rect" id="node26" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#ae4f73b41b502a7f05073a7327d0491b2" title="filesystem.server.file.File\lHandler.writeCommit" alt="" coords="219,645,387,686"/><area shape="rect" id="node7" href="classfilesystem_1_1server_1_1file_1_1FileHandler.html#addd8143d9e8114de949672b7c129ad3d" title="filesystem.server.file.File\lHandler.getName" alt="" coords="435,63,603,105"/></map>
</div>
</p>

</div>
</div>
<hr/>A documentação para esta classe foi gerada a partir do seguinte arquivo:<ul>
<li>src/filesystem/server/<a class="el" href="ServerConnection_8java.html">ServerConnection.java</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Gerado por &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.1
</small></address>
</body>
</html>
